package com.xing.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xing.entity.SysUserRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysUserRoleDao extends BaseMapper<SysUserRoleEntity> {


    @Select("select role_id from sys_user_role where user_id = #{userId}")
    List<Long> getRoleIdByUserId(@Param("userId") Long userId);

    @Select("SELECT id FROM sys_role WHERE name = #{roleName}")
    Long getRoleIdByRoleName(@Param("roleName") String roleName);
}
